// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   Cloud Monitoring API Version v2beta2
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='https://cloud.google.com/monitoring/v2beta2/'>Cloud Monitoring API</a>
 *      <tr><th>API Version<td>v2beta2
 *      <tr><th>API Rev<td>20170320 (809)
 *      <tr><th>API Docs
 *          <td><a href='https://cloud.google.com/monitoring/v2beta2/'>
 *              https://cloud.google.com/monitoring/v2beta2/</a>
 *      <tr><th>Discovery Name<td>cloudmonitoring
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using Cloud Monitoring API can be found at
 * <a href='https://cloud.google.com/monitoring/v2beta2/'>https://cloud.google.com/monitoring/v2beta2/</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.CloudMonitoring.v2beta2
{
    /// <summary>The CloudMonitoring Service.</summary>
    public class CloudMonitoringService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v2beta2";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public CloudMonitoringService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public CloudMonitoringService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            metricDescriptors = new MetricDescriptorsResource(this);
            timeseries = new TimeseriesResource(this);
            timeseriesDescriptors = new TimeseriesDescriptorsResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "cloudmonitoring"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return "cloudmonitoring/v2beta2/projects/"; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the Cloud Monitoring API.</summary>
        public class Scope
        {
            /// <summary>View and manage your data across Google Cloud Platform services</summary>
            public static string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform";

            /// <summary>View and write monitoring data for all of your Google and third-party Cloud and API
            /// projects</summary>
            public static string Monitoring = "https://www.googleapis.com/auth/monitoring";

        }



        private readonly MetricDescriptorsResource metricDescriptors;

        /// <summary>Gets the MetricDescriptors resource.</summary>
        public virtual MetricDescriptorsResource MetricDescriptors
        {
            get { return metricDescriptors; }
        }

        private readonly TimeseriesResource timeseries;

        /// <summary>Gets the Timeseries resource.</summary>
        public virtual TimeseriesResource Timeseries
        {
            get { return timeseries; }
        }

        private readonly TimeseriesDescriptorsResource timeseriesDescriptors;

        /// <summary>Gets the TimeseriesDescriptors resource.</summary>
        public virtual TimeseriesDescriptorsResource TimeseriesDescriptors
        {
            get { return timeseriesDescriptors; }
        }
    }

    ///<summary>A base abstract class for CloudMonitoring requests.</summary>
    public abstract class CloudMonitoringBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new CloudMonitoringBaseServiceRequest instance.</summary>
        protected CloudMonitoringBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>Data format for the response.</summary>
        /// [default: json]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for the response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
        }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>IP address of the site where the request originates. Use this if you want to enforce per-user
        /// limits.</summary>
        [Google.Apis.Util.RequestParameterAttribute("userIp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UserIp { get; set; }

        /// <summary>Initializes CloudMonitoring parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "json",
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "userIp", new Google.Apis.Discovery.Parameter
                {
                    Name = "userIp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "metricDescriptors" collection of methods.</summary>
    public class MetricDescriptorsResource
    {
        private const string Resource = "metricDescriptors";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public MetricDescriptorsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Create a new metric.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="project">The project id. The value can be the numeric project ID or string-based project
        /// name.</param>
        public virtual CreateRequest Create(Google.Apis.CloudMonitoring.v2beta2.Data.MetricDescriptor body, string project)
        {
            return new CreateRequest(service, body, project);
        }

        /// <summary>Create a new metric.</summary>
        public class CreateRequest : CloudMonitoringBaseServiceRequest<Google.Apis.CloudMonitoring.v2beta2.Data.MetricDescriptor>
        {
            /// <summary>Constructs a new Create request.</summary>
            public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudMonitoring.v2beta2.Data.MetricDescriptor body, string project)
                : base(service)
            {
                Project = project;
                Body = body;
                InitParameters();
            }


            /// <summary>The project id. The value can be the numeric project ID or string-based project name.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.CloudMonitoring.v2beta2.Data.MetricDescriptor Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "create"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/metricDescriptors"; }
            }

            /// <summary>Initializes Create parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Delete an existing metric.</summary>
        /// <param name="project">The project ID to which the metric belongs.</param>
        /// <param name="metric">Name of the
        /// metric.</param>
        public virtual DeleteRequest Delete(string project, string metric)
        {
            return new DeleteRequest(service, project, metric);
        }

        /// <summary>Delete an existing metric.</summary>
        public class DeleteRequest : CloudMonitoringBaseServiceRequest<Google.Apis.CloudMonitoring.v2beta2.Data.DeleteMetricDescriptorResponse>
        {
            /// <summary>Constructs a new Delete request.</summary>
            public DeleteRequest(Google.Apis.Services.IClientService service, string project, string metric)
                : base(service)
            {
                Project = project;
                Metric = metric;
                InitParameters();
            }


            /// <summary>The project ID to which the metric belongs.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }

            /// <summary>Name of the metric.</summary>
            [Google.Apis.Util.RequestParameterAttribute("metric", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Metric { get; private set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "delete"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "DELETE"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/metricDescriptors/{metric}"; }
            }

            /// <summary>Initializes Delete parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "metric", new Google.Apis.Discovery.Parameter
                    {
                        Name = "metric",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>List metric descriptors that match the query. If the query is not set, then all of the metric
        /// descriptors will be returned. Large responses will be paginated, use the nextPageToken returned in the
        /// response to request subsequent pages of results by setting the pageToken query parameter to the value of the
        /// nextPageToken.</summary>
        /// <param name="project">The project id. The value can be the numeric project ID or string-based project
        /// name.</param>
        public virtual ListRequest List(string project)
        {
            return new ListRequest(service, project);
        }

        /// <summary>List metric descriptors that match the query. If the query is not set, then all of the metric
        /// descriptors will be returned. Large responses will be paginated, use the nextPageToken returned in the
        /// response to request subsequent pages of results by setting the pageToken query parameter to the value of the
        /// nextPageToken.</summary>
        public class ListRequest : CloudMonitoringBaseServiceRequest<Google.Apis.CloudMonitoring.v2beta2.Data.ListMetricDescriptorsResponse>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service, string project)
                : base(service)
            {
                Project = project;
                InitParameters();
            }


            /// <summary>The project id. The value can be the numeric project ID or string-based project name.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }

            /// <summary>Maximum number of metric descriptors per page. Used for pagination. If not specified, count =
            /// 100.</summary>
            /// [default: 100]
            /// [minimum: 1]
            /// [maximum: 1000]
            [Google.Apis.Util.RequestParameterAttribute("count", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<int> Count { get; set; }

            /// <summary>The pagination token, which is used to page through large result sets. Set this value to the
            /// value of the nextPageToken to retrieve the next page of results.</summary>
            [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string PageToken { get; set; }

            /// <summary>The query used to search against existing metrics. Separate keywords with a space; the service
            /// joins all keywords with AND, meaning that all keywords must match for a metric to be returned. If this
            /// field is omitted, all metrics are returned. If an empty string is passed with this field, no metrics are
            /// returned.</summary>
            [Google.Apis.Util.RequestParameterAttribute("query", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Query { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/metricDescriptors"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "count", new Google.Apis.Discovery.Parameter
                    {
                        Name = "count",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = "100",
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "pageToken", new Google.Apis.Discovery.Parameter
                    {
                        Name = "pageToken",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "query", new Google.Apis.Discovery.Parameter
                    {
                        Name = "query",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }

    /// <summary>The "timeseries" collection of methods.</summary>
    public class TimeseriesResource
    {
        private const string Resource = "timeseries";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public TimeseriesResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>List the data points of the time series that match the metric and labels values and that have data
        /// points in the interval. Large responses are paginated; use the nextPageToken returned in the response to
        /// request subsequent pages of results by setting the pageToken query parameter to the value of the
        /// nextPageToken.</summary>
        /// <param name="project">The project ID to which this time series belongs. The value can be the numeric project ID or
        /// string-based project name.</param>
        /// <param name="metric">Metric names are protocol-free URLs as listed in the
        /// Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.</param>
        /// <param
        /// name="youngest">End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.</param>
        public virtual ListRequest List(string project, string metric, string youngest)
        {
            return new ListRequest(service, project, metric, youngest);
        }

        /// <summary>List the data points of the time series that match the metric and labels values and that have data
        /// points in the interval. Large responses are paginated; use the nextPageToken returned in the response to
        /// request subsequent pages of results by setting the pageToken query parameter to the value of the
        /// nextPageToken.</summary>
        public class ListRequest : CloudMonitoringBaseServiceRequest<Google.Apis.CloudMonitoring.v2beta2.Data.ListTimeseriesResponse>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service, string project, string metric, string youngest)
                : base(service)
            {
                Project = project;
                Metric = metric;
                Youngest = youngest;
                InitParameters();
            }


            /// <summary>The project ID to which this time series belongs. The value can be the numeric project ID or
            /// string-based project name.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }

            /// <summary>Metric names are protocol-free URLs as listed in the Supported Metrics page. For example,
            /// compute.googleapis.com/instance/disk/read_ops_count.</summary>
            [Google.Apis.Util.RequestParameterAttribute("metric", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Metric { get; private set; }

            /// <summary>End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.</summary>
            [Google.Apis.Util.RequestParameterAttribute("youngest", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Youngest { get; private set; }

            /// <summary>The aggregation function that will reduce the data points in each window to a single point.
            /// This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.</summary>
            [Google.Apis.Util.RequestParameterAttribute("aggregator", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<AggregatorEnum> Aggregator { get; set; }

            /// <summary>The aggregation function that will reduce the data points in each window to a single point.
            /// This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.</summary>
            public enum AggregatorEnum
            {
                [Google.Apis.Util.StringValueAttribute("max")]
                Max,
                [Google.Apis.Util.StringValueAttribute("mean")]
                Mean,
                [Google.Apis.Util.StringValueAttribute("min")]
                Min,
                [Google.Apis.Util.StringValueAttribute("sum")]
                Sum,
            }

            /// <summary>Maximum number of data points per page, which is used for pagination of results.</summary>
            /// [default: 6000]
            /// [minimum: 1]
            /// [maximum: 12000]
            [Google.Apis.Util.RequestParameterAttribute("count", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<int> Count { get; set; }

            /// <summary>A collection of labels for the matching time series, which are represented as: - key==value:
            /// key equals the value - key=~value: key regex matches the value - key!=value: key does not equal the
            /// value - key!~value: key regex does not match the value  For example, to list all of the time series
            /// descriptors for the region us-central1, you could specify: label=cloud.googleapis.com%2Flocation=~us-
            /// central1.*</summary>
            [Google.Apis.Util.RequestParameterAttribute("labels", Google.Apis.Util.RequestParameterType.Query)]
            public virtual Google.Apis.Util.Repeatable<string> Labels { get; set; }

            /// <summary>Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither
            /// oldest nor timespan is specified, the default time interval will be (youngest - 4 hours,
            /// youngest]</summary>
            [Google.Apis.Util.RequestParameterAttribute("oldest", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Oldest { get; set; }

            /// <summary>The pagination token, which is used to page through large result sets. Set this value to the
            /// value of the nextPageToken to retrieve the next page of results.</summary>
            [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string PageToken { get; set; }

            /// <summary>Length of the time interval to query, which is an alternative way to declare the interval:
            /// (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together. Units:
            /// - s: second - m: minute - h: hour - d: day - w: week  Examples: 2s, 3m, 4w. Only one unit is allowed,
            /// for example: 2w3d is not allowed; you should use 17d instead.
            ///
            /// If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours,
            /// youngest].</summary>
            [Google.Apis.Util.RequestParameterAttribute("timespan", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Timespan { get; set; }

            /// <summary>The sampling window. At most one data point will be returned for each window in the requested
            /// time interval. This parameter is only valid for non-cumulative metric types. Units: - m: minute - h:
            /// hour - d: day - w: week  Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed;
            /// you should use 17d instead.</summary>
            [Google.Apis.Util.RequestParameterAttribute("window", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Window { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/timeseries/{metric}"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "metric", new Google.Apis.Discovery.Parameter
                    {
                        Name = "metric",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "youngest", new Google.Apis.Discovery.Parameter
                    {
                        Name = "youngest",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "aggregator", new Google.Apis.Discovery.Parameter
                    {
                        Name = "aggregator",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "count", new Google.Apis.Discovery.Parameter
                    {
                        Name = "count",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = "6000",
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "labels", new Google.Apis.Discovery.Parameter
                    {
                        Name = "labels",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"(.+?)(==|=~|!=|!~)(.+)",
                    });
                RequestParameters.Add(
                    "oldest", new Google.Apis.Discovery.Parameter
                    {
                        Name = "oldest",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "pageToken", new Google.Apis.Discovery.Parameter
                    {
                        Name = "pageToken",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "timespan", new Google.Apis.Discovery.Parameter
                    {
                        Name = "timespan",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[0-9]+[smhdw]?",
                    });
                RequestParameters.Add(
                    "window", new Google.Apis.Discovery.Parameter
                    {
                        Name = "window",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[0-9]+[mhdw]?",
                    });
            }

        }

        /// <summary>Put data points to one or more time series for one or more metrics. If a time series does not
        /// exist, a new time series will be created. It is not allowed to write a time series point that is older than
        /// the existing youngest point of that time series. Points that are older than the existing youngest point of
        /// that time series will be discarded silently. Therefore, users should make sure that points of a time series
        /// are written sequentially in the order of their end time.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="project">The project ID. The value can be the numeric project ID or string-based project
        /// name.</param>
        public virtual WriteRequest Write(Google.Apis.CloudMonitoring.v2beta2.Data.WriteTimeseriesRequest body, string project)
        {
            return new WriteRequest(service, body, project);
        }

        /// <summary>Put data points to one or more time series for one or more metrics. If a time series does not
        /// exist, a new time series will be created. It is not allowed to write a time series point that is older than
        /// the existing youngest point of that time series. Points that are older than the existing youngest point of
        /// that time series will be discarded silently. Therefore, users should make sure that points of a time series
        /// are written sequentially in the order of their end time.</summary>
        public class WriteRequest : CloudMonitoringBaseServiceRequest<Google.Apis.CloudMonitoring.v2beta2.Data.WriteTimeseriesResponse>
        {
            /// <summary>Constructs a new Write request.</summary>
            public WriteRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudMonitoring.v2beta2.Data.WriteTimeseriesRequest body, string project)
                : base(service)
            {
                Project = project;
                Body = body;
                InitParameters();
            }


            /// <summary>The project ID. The value can be the numeric project ID or string-based project name.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.CloudMonitoring.v2beta2.Data.WriteTimeseriesRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "write"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/timeseries:write"; }
            }

            /// <summary>Initializes Write parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }

    /// <summary>The "timeseriesDescriptors" collection of methods.</summary>
    public class TimeseriesDescriptorsResource
    {
        private const string Resource = "timeseriesDescriptors";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public TimeseriesDescriptorsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>List the descriptors of the time series that match the metric and labels values and that have data
        /// points in the interval. Large responses are paginated; use the nextPageToken returned in the response to
        /// request subsequent pages of results by setting the pageToken query parameter to the value of the
        /// nextPageToken.</summary>
        /// <param name="project">The project ID to which this time series belongs. The value can be the numeric project ID or
        /// string-based project name.</param>
        /// <param name="metric">Metric names are protocol-free URLs as listed in the
        /// Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.</param>
        /// <param
        /// name="youngest">End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.</param>
        public virtual ListRequest List(string project, string metric, string youngest)
        {
            return new ListRequest(service, project, metric, youngest);
        }

        /// <summary>List the descriptors of the time series that match the metric and labels values and that have data
        /// points in the interval. Large responses are paginated; use the nextPageToken returned in the response to
        /// request subsequent pages of results by setting the pageToken query parameter to the value of the
        /// nextPageToken.</summary>
        public class ListRequest : CloudMonitoringBaseServiceRequest<Google.Apis.CloudMonitoring.v2beta2.Data.ListTimeseriesDescriptorsResponse>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service, string project, string metric, string youngest)
                : base(service)
            {
                Project = project;
                Metric = metric;
                Youngest = youngest;
                InitParameters();
            }


            /// <summary>The project ID to which this time series belongs. The value can be the numeric project ID or
            /// string-based project name.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }

            /// <summary>Metric names are protocol-free URLs as listed in the Supported Metrics page. For example,
            /// compute.googleapis.com/instance/disk/read_ops_count.</summary>
            [Google.Apis.Util.RequestParameterAttribute("metric", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Metric { get; private set; }

            /// <summary>End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.</summary>
            [Google.Apis.Util.RequestParameterAttribute("youngest", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Youngest { get; private set; }

            /// <summary>The aggregation function that will reduce the data points in each window to a single point.
            /// This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.</summary>
            [Google.Apis.Util.RequestParameterAttribute("aggregator", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<AggregatorEnum> Aggregator { get; set; }

            /// <summary>The aggregation function that will reduce the data points in each window to a single point.
            /// This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.</summary>
            public enum AggregatorEnum
            {
                [Google.Apis.Util.StringValueAttribute("max")]
                Max,
                [Google.Apis.Util.StringValueAttribute("mean")]
                Mean,
                [Google.Apis.Util.StringValueAttribute("min")]
                Min,
                [Google.Apis.Util.StringValueAttribute("sum")]
                Sum,
            }

            /// <summary>Maximum number of time series descriptors per page. Used for pagination. If not specified,
            /// count = 100.</summary>
            /// [default: 100]
            /// [minimum: 1]
            /// [maximum: 1000]
            [Google.Apis.Util.RequestParameterAttribute("count", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<int> Count { get; set; }

            /// <summary>A collection of labels for the matching time series, which are represented as: - key==value:
            /// key equals the value - key=~value: key regex matches the value - key!=value: key does not equal the
            /// value - key!~value: key regex does not match the value  For example, to list all of the time series
            /// descriptors for the region us-central1, you could specify: label=cloud.googleapis.com%2Flocation=~us-
            /// central1.*</summary>
            [Google.Apis.Util.RequestParameterAttribute("labels", Google.Apis.Util.RequestParameterType.Query)]
            public virtual Google.Apis.Util.Repeatable<string> Labels { get; set; }

            /// <summary>Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither
            /// oldest nor timespan is specified, the default time interval will be (youngest - 4 hours,
            /// youngest]</summary>
            [Google.Apis.Util.RequestParameterAttribute("oldest", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Oldest { get; set; }

            /// <summary>The pagination token, which is used to page through large result sets. Set this value to the
            /// value of the nextPageToken to retrieve the next page of results.</summary>
            [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string PageToken { get; set; }

            /// <summary>Length of the time interval to query, which is an alternative way to declare the interval:
            /// (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together. Units:
            /// - s: second - m: minute - h: hour - d: day - w: week  Examples: 2s, 3m, 4w. Only one unit is allowed,
            /// for example: 2w3d is not allowed; you should use 17d instead.
            ///
            /// If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours,
            /// youngest].</summary>
            [Google.Apis.Util.RequestParameterAttribute("timespan", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Timespan { get; set; }

            /// <summary>The sampling window. At most one data point will be returned for each window in the requested
            /// time interval. This parameter is only valid for non-cumulative metric types. Units: - m: minute - h:
            /// hour - d: day - w: week  Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed;
            /// you should use 17d instead.</summary>
            [Google.Apis.Util.RequestParameterAttribute("window", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Window { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/timeseriesDescriptors/{metric}"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "metric", new Google.Apis.Discovery.Parameter
                    {
                        Name = "metric",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "youngest", new Google.Apis.Discovery.Parameter
                    {
                        Name = "youngest",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "aggregator", new Google.Apis.Discovery.Parameter
                    {
                        Name = "aggregator",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "count", new Google.Apis.Discovery.Parameter
                    {
                        Name = "count",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = "100",
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "labels", new Google.Apis.Discovery.Parameter
                    {
                        Name = "labels",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"(.+?)(==|=~|!=|!~)(.+)",
                    });
                RequestParameters.Add(
                    "oldest", new Google.Apis.Discovery.Parameter
                    {
                        Name = "oldest",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "pageToken", new Google.Apis.Discovery.Parameter
                    {
                        Name = "pageToken",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "timespan", new Google.Apis.Discovery.Parameter
                    {
                        Name = "timespan",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[0-9]+[smhdw]?",
                    });
                RequestParameters.Add(
                    "window", new Google.Apis.Discovery.Parameter
                    {
                        Name = "window",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[0-9]+[mhdw]?",
                    });
            }

        }
    }
}

namespace Google.Apis.CloudMonitoring.v2beta2.Data
{    

    /// <summary>The response of cloudmonitoring.metricDescriptors.delete.</summary>
    public class DeleteMetricDescriptorResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Identifies what kind of resource this is. Value: the fixed string
        /// "cloudmonitoring#deleteMetricDescriptorResponse".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The request of cloudmonitoring.metricDescriptors.list.</summary>
    public class ListMetricDescriptorsRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Identifies what kind of resource this is. Value: the fixed string
        /// "cloudmonitoring#listMetricDescriptorsRequest".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The response of cloudmonitoring.metricDescriptors.list.</summary>
    public class ListMetricDescriptorsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Identifies what kind of resource this is. Value: the fixed string
        /// "cloudmonitoring#listMetricDescriptorsResponse".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>The returned metric descriptors.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("metrics")]
        public virtual System.Collections.Generic.IList<MetricDescriptor> Metrics { get; set; } 

        /// <summary>Pagination token. If present, indicates that additional results are available for retrieval. To
        /// access the results past the pagination limit, pass this value to the pageToken query parameter.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The request of cloudmonitoring.timeseriesDescriptors.list</summary>
    public class ListTimeseriesDescriptorsRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Identifies what kind of resource this is. Value: the fixed string
        /// "cloudmonitoring#listTimeseriesDescriptorsRequest".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The response of cloudmonitoring.timeseriesDescriptors.list</summary>
    public class ListTimeseriesDescriptorsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Identifies what kind of resource this is. Value: the fixed string
        /// "cloudmonitoring#listTimeseriesDescriptorsResponse".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>Pagination token. If present, indicates that additional results are available for retrieval. To
        /// access the results past the pagination limit, set this value to the pageToken query parameter.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The oldest timestamp of the interval of this query, as an RFC 3339 string.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("oldest")]
        public virtual string OldestRaw { get; set; }

        /// <summary><seealso cref="System.DateTime"/> representation of <see cref="OldestRaw"/>.</summary>
        [Newtonsoft.Json.JsonIgnore]
        public virtual System.Nullable<System.DateTime> Oldest
        {
            get
            {
                return Google.Apis.Util.Utilities.GetDateTimeFromString(OldestRaw);
            }
            set
            {
                OldestRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
            }
        }

        /// <summary>The returned time series descriptors.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("timeseries")]
        public virtual System.Collections.Generic.IList<TimeseriesDescriptor> Timeseries { get; set; } 

        /// <summary>The youngest timestamp of the interval of this query, as an RFC 3339 string.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("youngest")]
        public virtual string YoungestRaw { get; set; }

        /// <summary><seealso cref="System.DateTime"/> representation of <see cref="YoungestRaw"/>.</summary>
        [Newtonsoft.Json.JsonIgnore]
        public virtual System.Nullable<System.DateTime> Youngest
        {
            get
            {
                return Google.Apis.Util.Utilities.GetDateTimeFromString(YoungestRaw);
            }
            set
            {
                YoungestRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
            }
        }

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The request of cloudmonitoring.timeseries.list</summary>
    public class ListTimeseriesRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Identifies what kind of resource this is. Value: the fixed string
        /// "cloudmonitoring#listTimeseriesRequest".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The response of cloudmonitoring.timeseries.list</summary>
    public class ListTimeseriesResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Identifies what kind of resource this is. Value: the fixed string
        /// "cloudmonitoring#listTimeseriesResponse".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>Pagination token. If present, indicates that additional results are available for retrieval. To
        /// access the results past the pagination limit, set the pageToken query parameter to this value. All of the
        /// points of a time series will be returned before returning any point of the subsequent time series.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The oldest timestamp of the interval of this query as an RFC 3339 string.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("oldest")]
        public virtual string OldestRaw { get; set; }

        /// <summary><seealso cref="System.DateTime"/> representation of <see cref="OldestRaw"/>.</summary>
        [Newtonsoft.Json.JsonIgnore]
        public virtual System.Nullable<System.DateTime> Oldest
        {
            get
            {
                return Google.Apis.Util.Utilities.GetDateTimeFromString(OldestRaw);
            }
            set
            {
                OldestRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
            }
        }

        /// <summary>The returned time series.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("timeseries")]
        public virtual System.Collections.Generic.IList<Timeseries> Timeseries { get; set; } 

        /// <summary>The youngest timestamp of the interval of this query as an RFC 3339 string.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("youngest")]
        public virtual string YoungestRaw { get; set; }

        /// <summary><seealso cref="System.DateTime"/> representation of <see cref="YoungestRaw"/>.</summary>
        [Newtonsoft.Json.JsonIgnore]
        public virtual System.Nullable<System.DateTime> Youngest
        {
            get
            {
                return Google.Apis.Util.Utilities.GetDateTimeFromString(YoungestRaw);
            }
            set
            {
                YoungestRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
            }
        }

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A metricDescriptor defines the name, label keys, and data type of a particular metric.</summary>
    public class MetricDescriptor : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Description of this metric.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("description")]
        public virtual string Description { get; set; } 

        /// <summary>Labels defined for this metric.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("labels")]
        public virtual System.Collections.Generic.IList<MetricDescriptorLabelDescriptor> Labels { get; set; } 

        /// <summary>The name of this metric.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>The project ID to which the metric belongs.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("project")]
        public virtual string Project { get; set; } 

        /// <summary>Type description for this metric.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("typeDescriptor")]
        public virtual MetricDescriptorTypeDescriptor TypeDescriptor { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A label in a metric is a description of this metric, including the key of this description (what the
    /// description is), and the value for this description.</summary>
    public class MetricDescriptorLabelDescriptor : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Label description.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("description")]
        public virtual string Description { get; set; } 

        /// <summary>Label key.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("key")]
        public virtual string Key { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A type in a metric contains information about how the metric is collected and what its data points look
    /// like.</summary>
    public class MetricDescriptorTypeDescriptor : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The method of collecting data for the metric. See Metric types.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("metricType")]
        public virtual string MetricType { get; set; } 

        /// <summary>The data type of of individual points in the metric's time series. See Metric value
        /// types.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("valueType")]
        public virtual string ValueType { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Point is a single point in a time series. It consists of a start time, an end time, and a
    /// value.</summary>
    public class Point : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The value of this data point. Either "true" or "false".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("boolValue")]
        public virtual System.Nullable<bool> BoolValue { get; set; } 

        /// <summary>The value of this data point as a distribution. A distribution value can contain a list of buckets
        /// and/or an underflowBucket and an overflowBucket. The values of these points can be used to create a
        /// histogram.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("distributionValue")]
        public virtual PointDistribution DistributionValue { get; set; } 

        /// <summary>The value of this data point as a double-precision floating-point number.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("doubleValue")]
        public virtual System.Nullable<double> DoubleValue { get; set; } 

        /// <summary>The interval [start, end] is the time period to which the point's value applies. For gauge metrics,
        /// whose values are instantaneous measurements, this interval should be empty (start should equal end). For
        /// cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both
        /// start and end are RFC 3339 strings.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("end")]
        public virtual string EndRaw { get; set; }

        /// <summary><seealso cref="System.DateTime"/> representation of <see cref="EndRaw"/>.</summary>
        [Newtonsoft.Json.JsonIgnore]
        public virtual System.Nullable<System.DateTime> End
        {
            get
            {
                return Google.Apis.Util.Utilities.GetDateTimeFromString(EndRaw);
            }
            set
            {
                EndRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
            }
        }

        /// <summary>The value of this data point as a 64-bit integer.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("int64Value")]
        public virtual System.Nullable<long> Int64Value { get; set; } 

        /// <summary>The interval [start, end] is the time period to which the point's value applies. For gauge metrics,
        /// whose values are instantaneous measurements, this interval should be empty (start should equal end). For
        /// cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both
        /// start and end are RFC 3339 strings.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("start")]
        public virtual string StartRaw { get; set; }

        /// <summary><seealso cref="System.DateTime"/> representation of <see cref="StartRaw"/>.</summary>
        [Newtonsoft.Json.JsonIgnore]
        public virtual System.Nullable<System.DateTime> Start
        {
            get
            {
                return Google.Apis.Util.Utilities.GetDateTimeFromString(StartRaw);
            }
            set
            {
                StartRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
            }
        }

        /// <summary>The value of this data point in string format.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("stringValue")]
        public virtual string StringValue { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Distribution data point value type. When writing distribution points, try to be consistent with the
    /// boundaries of your buckets. If you must modify the bucket boundaries, then do so by merging, partitioning, or
    /// appending rather than skewing them.</summary>
    public class PointDistribution : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The finite buckets.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("buckets")]
        public virtual System.Collections.Generic.IList<PointDistributionBucket> Buckets { get; set; } 

        /// <summary>The overflow bucket.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("overflowBucket")]
        public virtual PointDistributionOverflowBucket OverflowBucket { get; set; } 

        /// <summary>The underflow bucket.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("underflowBucket")]
        public virtual PointDistributionUnderflowBucket UnderflowBucket { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The histogram's bucket. Buckets that form the histogram of a distribution value. If the upper bound of
    /// a bucket, say U1, does not equal the lower bound of the next bucket, say L2, this means that there is no event
    /// in [U1, L2).</summary>
    public class PointDistributionBucket : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The number of events whose values are in the interval defined by this bucket.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("count")]
        public virtual System.Nullable<long> Count { get; set; } 

        /// <summary>The lower bound of the value interval of this bucket (inclusive).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("lowerBound")]
        public virtual System.Nullable<double> LowerBound { get; set; } 

        /// <summary>The upper bound of the value interval of this bucket (exclusive).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("upperBound")]
        public virtual System.Nullable<double> UpperBound { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The overflow bucket is a special bucket that does not have the upperBound field; it includes all of the
    /// events that are no less than its lower bound.</summary>
    public class PointDistributionOverflowBucket : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The number of events whose values are in the interval defined by this bucket.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("count")]
        public virtual System.Nullable<long> Count { get; set; } 

        /// <summary>The lower bound of the value interval of this bucket (inclusive).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("lowerBound")]
        public virtual System.Nullable<double> LowerBound { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The underflow bucket is a special bucket that does not have the lowerBound field; it includes all of
    /// the events that are less than its upper bound.</summary>
    public class PointDistributionUnderflowBucket : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The number of events whose values are in the interval defined by this bucket.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("count")]
        public virtual System.Nullable<long> Count { get; set; } 

        /// <summary>The upper bound of the value interval of this bucket (exclusive).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("upperBound")]
        public virtual System.Nullable<double> UpperBound { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The monitoring data is organized as metrics and stored as data points that are recorded over time. Each
    /// data point represents information like the CPU utilization of your virtual machine. A historical record of these
    /// data points is called a time series.</summary>
    public class Timeseries : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The data points of this time series. The points are listed in order of their end timestamp, from
        /// younger to older.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("points")]
        public virtual System.Collections.Generic.IList<Point> Points { get; set; } 

        /// <summary>The descriptor of this time series.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("timeseriesDesc")]
        public virtual TimeseriesDescriptor TimeseriesDesc { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>TimeseriesDescriptor identifies a single time series.</summary>
    public class TimeseriesDescriptor : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The label's name.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("labels")]
        public virtual System.Collections.Generic.IDictionary<string,string> Labels { get; set; } 

        /// <summary>The name of the metric.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("metric")]
        public virtual string Metric { get; set; } 

        /// <summary>The Developers Console project number to which this time series belongs.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("project")]
        public virtual string Project { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class TimeseriesDescriptorLabel : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The label's name.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("key")]
        public virtual string Key { get; set; } 

        /// <summary>The label's value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("value")]
        public virtual string Value { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>When writing time series, TimeseriesPoint should be used instead of Timeseries, to enforce single point
    /// for each time series in the timeseries.write request.</summary>
    public class TimeseriesPoint : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The data point in this time series snapshot.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("point")]
        public virtual Point Point { get; set; } 

        /// <summary>The descriptor of this time series.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("timeseriesDesc")]
        public virtual TimeseriesDescriptor TimeseriesDesc { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The request of cloudmonitoring.timeseries.write</summary>
    public class WriteTimeseriesRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The label's name.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("commonLabels")]
        public virtual System.Collections.Generic.IDictionary<string,string> CommonLabels { get; set; } 

        /// <summary>Provide time series specific labels and the data points for each time series. The labels in
        /// timeseries and the common_labels should form a complete list of labels that required by the
        /// metric.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("timeseries")]
        public virtual System.Collections.Generic.IList<TimeseriesPoint> Timeseries { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The response of cloudmonitoring.timeseries.write</summary>
    public class WriteTimeseriesResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Identifies what kind of resource this is. Value: the fixed string
        /// "cloudmonitoring#writeTimeseriesResponse".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }
}
